package com.futureweaver.controller;

import com.futureweaver.domain.MedicalRecord;
import com.futureweaver.service.MedicalRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/medical_record")
public class MedicalRecordController {
    @Autowired
    private MedicalRecordService service;

    @RequestMapping("/insert")
    @ResponseBody
    public boolean insert(@RequestBody MedicalRecord medicalRecord) {
        return service.insert(medicalRecord);
    }

    @RequestMapping("/update")
    @ResponseBody
    public boolean update(@RequestBody MedicalRecord medicalRecord) {
        return service.update(medicalRecord);
    }
}
